<template>
    <div class="teacher-home">
        <el-container>
            <el-aside width="200px">
                <h3>USTH教务管理系统</h3>
                <el-row>
                    <el-menu default-active="/product" class="el-menu-vertical-demo"
                    background-color="rgba(4, 24, 50)"
                        text-color="#fff" router active-text-color="#ffd04b">
                        <el-menu-item index="/teacher/course">
                            <i class="el-icon-search"></i>
                            <span slot="title">课程查询</span>
                        </el-menu-item>
                        <el-submenu index="/teacher">
                            <template slot="title">
                                <i class="el-icon-mouse"></i>
                                <span>修改成绩</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="/teacher/subject">学科查询</el-menu-item>
                                <el-menu-item index="/teacher/SearchStudent">学生查询</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-menu-item index="/login" @click="logout">
                            <i class="el-icon-thumb"></i>
                            <span slot="title">退出登录</span>
                        </el-menu-item>
                    </el-menu>
                </el-row>
            </el-aside>
            <el-container>
                <el-header></el-header>
                <el-main>
                    <router-view></router-view>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<script>
export default {
    name: 'TeacherHome',
    methods: {
        logout() {
            this.$router.push('/login');
        }
    }
};
</script>

<style scoped>
.el-aside {
    height: 100vh;
    background-color: rgba(4, 24, 50);
}

.el-header {
    background-color: rgb(230, 232, 242);
}

.el-aside > h3 {
    color: #29325a;
    height: 60px;
    text-align: center;
    line-height: 60px;
    background-color: rgb(230, 232, 242);
}

.teacher-home {
    text-align: center;
}

/* 添加鼠标悬停样式 */
.el-menu-item span,
.el-submenu__title span {
    transition: color 0.3s, font-size 0.3s; /* 添加过渡效果 */
}

.el-menu-item:hover span,
.el-submenu__title:hover span {
    color: rgb(255, 204, 0); /* 文字颜色变为黄色 */
    font-size: 16px; /* 字体变大，这里可以根据需要调整大小 */
}

/* 确保子菜单项也应用相同的悬停样式 */
.el-submenu.el-menu-item span {
    transition: color 0.3s, font-size 0.3s; /* 添加过渡效果 */
}

.el-submenu.el-menu-item:hover span {
    color: rgb(255, 204, 0); /* 文字颜色变为黄色 */
    font-size: 16px; /* 字体变大，这里可以根据需要调整大小 */
}
</style>